//
//  ProgressHUD.m
//  ShowMe
//
//  Created by 123 on 2018/8/24.
//  Copyright © 2018年 nkl. All rights reserved.
//

#import "ProgressHUD.h"
#import <SVProgressHUD.h>
@implementation ProgressHUD

+(void)showSmallErroHUD:(NSString *)message{
    [self showHUDWithType:showSmallErrorType message:message];
}

+(void)showBigErroHUD:(NSString *)message{
    [self showHUDWithType:showBigErrorType message:message];
}

+(void)showSmallSuccessHUD:(NSString *)message{
    [self showHUDWithType:showSmallSuccessType message:message];
}

+(void)showBigSuccessHUD:(NSString *)message{
    [self showHUDWithType:showBigSuccessType message:message];
}

+(void)showHUDWithType:(HudShowType)type message:(NSString *)message{
    
    
    switch (type) {
        case showSmallErrorType:
            [SVProgressHUD showErrorWithStatus:message];
            [SVProgressHUD setBackgroundColor:[[UIColor blackColor]colorWithAlphaComponent:0.7]];
            [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
            [SVProgressHUD dismissWithDelay:0.5];
            break;
        case showBigErrorType:
            [SVProgressHUD showErrorWithStatus:message];
            [SVProgressHUD dismissWithDelay:1];
            [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
            break;
        case showSmallSuccessType:
            [SVProgressHUD showSuccessWithStatus:message];
            [SVProgressHUD setBackgroundColor:[[UIColor blackColor]colorWithAlphaComponent:0.7]];
            [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
            [SVProgressHUD dismissWithDelay:0.5];
            break;
        case showBigSuccessType:
            [SVProgressHUD showSuccessWithStatus:message];
            [SVProgressHUD dismissWithDelay:1];
            [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
            break;
        default:
            break;
    }
    
    
}
@end
